package cn.controller.product;

import cn.service.productService.ProductServiceImpl.BrandServiceImpl;
import entity.productEntity.Brand;
import entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 朱颢阳
 * @description
 * @time 2024/8/19 19:57
 */
@RestController
@CrossOrigin
@RequestMapping("/product")
public class BrandController {
    @Autowired
    BrandServiceImpl service;
    @RequestMapping("/selectBrandAll")
    public Result selectBrandAll(Integer currentPage,Integer pageSize){
        return service.selsectAll(currentPage,pageSize);
    }
    @RequestMapping("/searchbrand")
    public Result searchbrand(String key, Integer currentPage, Integer pageSize){
        return service.selectByKey(key,currentPage,pageSize);
    }
    @RequestMapping("/updatemanu")
    public Result updatemanu(Integer id,Integer manu){
        return service.updatemanu(id, manu);
    }
    @RequestMapping("/updateshow")
    public Result updateshow(Integer id,Integer show){
        return service.updateshow(id, show);
    }
    @RequestMapping("/deletebrand")
    public Result deletebrand(Integer id){
        return service.deletebrand(id);
    }
    @RequestMapping("/batchdelete")
    public Result batchdelete(@RequestBody List<Brand> brands){
        return service.batchdelete(brands);
    }
    @RequestMapping("/insertbrand")
    public Result insertbrand(@RequestBody Brand brand){
        return service.insertbrand(brand);
    }
    @RequestMapping("/updatabrand")
    public Result updatabrand(@RequestBody Brand brand){
        return service.updatabrand(brand);
    }
    @RequestMapping("/getbrandoption")
    public Result getbrandoption(){
        return service.getbrandoption();
    }
}
